﻿using System.Web;

namespace ASPItalia.ModelVirtualCasting.EntityFramework
{
	internal class WebContextContainer : IContextContainer
	{
        private const string CONTEXT_KEY = "EFObjectContext";

		public ModelVirtualCastingEntities Current
		{
            get { return (ModelVirtualCastingEntities)HttpContext.Current.Items[CONTEXT_KEY]; }
		}

		public void Clear()
		{
            HttpContext.Current.Items[CONTEXT_KEY] = new ModelVirtualCastingEntities();
		}
	}
}